// Copyright (c) 2016, SolidCP
// SolidCP is distributed under the Creative Commons Share-alike license
// 
// SolidCP is a fork of WebsitePanel:
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must  retain  the  above copyright notice, this
//   list of conditions and the following disclaimer.
//
// - Redistributions in binary form  must  reproduce the  above  copyright  notice,
//   this list of conditions  and  the  following  disclaimer in  the documentation
//   and/or other materials provided with the distribution.
//
// - Neither  the  name  of  the  Outercurve Foundation  nor   the   names  of  its
//   contributors may be used to endorse or  promote  products  derived  from  this
//   software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT  NOT  LIMITED TO, THE IMPLIED
// WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR  PURPOSE  ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO,  PROCUREMENT  OF  SUBSTITUTE  GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)  HOWEVER  CAUSED AND ON
// ANY  THEORY  OF  LIABILITY,  WHETHER  IN  CONTRACT,  STRICT  LIABILITY,  OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING  IN  ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.5466
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using SolidCP.Providers.Common;
using SolidCP.Providers.HostedSolution;
using SolidCP.Providers.ResultObjects;

// 
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
// 
namespace SolidCP.Providers.CRM {
    using System.Xml.Serialization;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Diagnostics;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="CRMSoap", Namespace="http://smbsaas/solidcp/server/")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))]
    public partial class CRM : Microsoft.Web.Services3.WebServicesClientProtocol {
        
        public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue;
        
        private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetSupportedCollationNamesOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCurrencyListOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetInstalledLanguagePacksOperationCompleted;
        
        private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted;
        
        private System.Threading.SendOrPostCallback CreateCRMUserOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetOrganizationBusinessUnitsOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetAllCrmRolesOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCrmUserRolesOperationCompleted;
        
        private System.Threading.SendOrPostCallback SetUserRolesOperationCompleted;
        
        private System.Threading.SendOrPostCallback SetUserCALTypeOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCrmUserByDomainNameOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCrmUserByIdOperationCompleted;
        
        private System.Threading.SendOrPostCallback ChangeUserStateOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetDBSizeOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetMaxDBSizeOperationCompleted;
        
        private System.Threading.SendOrPostCallback SetMaxDBSizeOperationCompleted;
        
        /// <remarks/>
        public CRM() {
            this.Url = "http://localhost:9003/CRM.asmx";
        }
        
        /// <remarks/>
        public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted;
        
        /// <remarks/>
        public event GetSupportedCollationNamesCompletedEventHandler GetSupportedCollationNamesCompleted;
        
        /// <remarks/>
        public event GetCurrencyListCompletedEventHandler GetCurrencyListCompleted;
        
        /// <remarks/>
        public event GetInstalledLanguagePacksCompletedEventHandler GetInstalledLanguagePacksCompleted;
        
        /// <remarks/>
        public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted;
        
        /// <remarks/>
        public event CreateCRMUserCompletedEventHandler CreateCRMUserCompleted;
        
        /// <remarks/>
        public event GetOrganizationBusinessUnitsCompletedEventHandler GetOrganizationBusinessUnitsCompleted;
        
        /// <remarks/>
        public event GetAllCrmRolesCompletedEventHandler GetAllCrmRolesCompleted;
        
        /// <remarks/>
        public event GetCrmUserRolesCompletedEventHandler GetCrmUserRolesCompleted;
        
        /// <remarks/>
        public event SetUserRolesCompletedEventHandler SetUserRolesCompleted;
        
        /// <remarks/>
        public event SetUserCALTypeCompletedEventHandler SetUserCALTypeCompleted;
        
        /// <remarks/>
        public event GetCrmUserByDomainNameCompletedEventHandler GetCrmUserByDomainNameCompleted;
        
        /// <remarks/>
        public event GetCrmUserByIdCompletedEventHandler GetCrmUserByIdCompleted;
        
        /// <remarks/>
        public event ChangeUserStateCompletedEventHandler ChangeUserStateCompleted;
        
        /// <remarks/>
        public event GetDBSizeCompletedEventHandler GetDBSizeCompleted;
        
        /// <remarks/>
        public event GetMaxDBSizeCompletedEventHandler GetMaxDBSizeCompleted;
        
        /// <remarks/>
        public event SetMaxDBSizeCompletedEventHandler SetMaxDBSizeCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/CreateOrganization", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public OrganizationResult CreateOrganization(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, int baseLanguageCode, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize) {
            object[] results = this.Invoke("CreateOrganization", new object[] {
                        organizationId,
                        organizationUniqueName,
                        organizationFriendlyName,
                        baseLanguageCode,
                        ou,
                        baseCurrencyCode,
                        baseCurrencyName,
                        baseCurrencySymbol,
                        initialUserDomainName,
                        initialUserFirstName,
                        initialUserLastName,
                        initialUserPrimaryEmail,
                        organizationCollation,
                        maxSize});
            return ((OrganizationResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCreateOrganization(
                    System.Guid organizationId, 
                    string organizationUniqueName, 
                    string organizationFriendlyName, 
                    int baseLanguageCode, 
                    string ou, 
                    string baseCurrencyCode, 
                    string baseCurrencyName, 
                    string baseCurrencySymbol, 
                    string initialUserDomainName, 
                    string initialUserFirstName, 
                    string initialUserLastName, 
                    string initialUserPrimaryEmail, 
                    string organizationCollation, 
                    long maxSize, 
                    System.AsyncCallback callback, 
                    object asyncState) {
            return this.BeginInvoke("CreateOrganization", new object[] {
                        organizationId,
                        organizationUniqueName,
                        organizationFriendlyName,
                        baseLanguageCode,
                        ou,
                        baseCurrencyCode,
                        baseCurrencyName,
                        baseCurrencySymbol,
                        initialUserDomainName,
                        initialUserFirstName,
                        initialUserLastName,
                        initialUserPrimaryEmail,
                        organizationCollation,
                        maxSize}, callback, asyncState);
        }
        
        /// <remarks/>
        public OrganizationResult EndCreateOrganization(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((OrganizationResult)(results[0]));
        }
        
        /// <remarks/>
        public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, int baseLanguageCode, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize) {
            this.CreateOrganizationAsync(organizationId, organizationUniqueName, organizationFriendlyName, baseLanguageCode, ou, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation, maxSize, null);
        }
        
        /// <remarks/>
        public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, int baseLanguageCode, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize, object userState) {
            if ((this.CreateOrganizationOperationCompleted == null)) {
                this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted);
            }
            this.InvokeAsync("CreateOrganization", new object[] {
                        organizationId,
                        organizationUniqueName,
                        organizationFriendlyName,
                        baseLanguageCode,
                        ou,
                        baseCurrencyCode,
                        baseCurrencyName,
                        baseCurrencySymbol,
                        initialUserDomainName,
                        initialUserFirstName,
                        initialUserLastName,
                        initialUserPrimaryEmail,
                        organizationCollation,
                        maxSize}, this.CreateOrganizationOperationCompleted, userState);
        }
        
        private void OnCreateOrganizationOperationCompleted(object arg) {
            if ((this.CreateOrganizationCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetSupportedCollationNames", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string[] GetSupportedCollationNames() {
            object[] results = this.Invoke("GetSupportedCollationNames", new object[0]);
            return ((string[])(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetSupportedCollationNames(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetSupportedCollationNames", new object[0], callback, asyncState);
        }
        
        /// <remarks/>
        public string[] EndGetSupportedCollationNames(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((string[])(results[0]));
        }
        
        /// <remarks/>
        public void GetSupportedCollationNamesAsync() {
            this.GetSupportedCollationNamesAsync(null);
        }
        
        /// <remarks/>
        public void GetSupportedCollationNamesAsync(object userState) {
            if ((this.GetSupportedCollationNamesOperationCompleted == null)) {
                this.GetSupportedCollationNamesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSupportedCollationNamesOperationCompleted);
            }
            this.InvokeAsync("GetSupportedCollationNames", new object[0], this.GetSupportedCollationNamesOperationCompleted, userState);
        }
        
        private void OnGetSupportedCollationNamesOperationCompleted(object arg) {
            if ((this.GetSupportedCollationNamesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetSupportedCollationNamesCompleted(this, new GetSupportedCollationNamesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetCurrencyList", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public Currency[] GetCurrencyList() {
            object[] results = this.Invoke("GetCurrencyList", new object[0]);
            return ((Currency[])(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCurrencyList(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCurrencyList", new object[0], callback, asyncState);
        }
        
        /// <remarks/>
        public Currency[] EndGetCurrencyList(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((Currency[])(results[0]));
        }
        
        /// <remarks/>
        public void GetCurrencyListAsync() {
            this.GetCurrencyListAsync(null);
        }
        
        /// <remarks/>
        public void GetCurrencyListAsync(object userState) {
            if ((this.GetCurrencyListOperationCompleted == null)) {
                this.GetCurrencyListOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCurrencyListOperationCompleted);
            }
            this.InvokeAsync("GetCurrencyList", new object[0], this.GetCurrencyListOperationCompleted, userState);
        }
        
        private void OnGetCurrencyListOperationCompleted(object arg) {
            if ((this.GetCurrencyListCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCurrencyListCompleted(this, new GetCurrencyListCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetInstalledLanguagePacks", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public int[] GetInstalledLanguagePacks() {
            object[] results = this.Invoke("GetInstalledLanguagePacks", new object[0]);
            return ((int[])(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetInstalledLanguagePacks(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetInstalledLanguagePacks", new object[0], callback, asyncState);
        }
        
        /// <remarks/>
        public int[] EndGetInstalledLanguagePacks(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((int[])(results[0]));
        }
        
        /// <remarks/>
        public void GetInstalledLanguagePacksAsync() {
            this.GetInstalledLanguagePacksAsync(null);
        }
        
        /// <remarks/>
        public void GetInstalledLanguagePacksAsync(object userState) {
            if ((this.GetInstalledLanguagePacksOperationCompleted == null)) {
                this.GetInstalledLanguagePacksOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetInstalledLanguagePacksOperationCompleted);
            }
            this.InvokeAsync("GetInstalledLanguagePacks", new object[0], this.GetInstalledLanguagePacksOperationCompleted, userState);
        }
        
        private void OnGetInstalledLanguagePacksOperationCompleted(object arg) {
            if ((this.GetInstalledLanguagePacksCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetInstalledLanguagePacksCompleted(this, new GetInstalledLanguagePacksCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/DeleteOrganization", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject DeleteOrganization(System.Guid orgId) {
            object[] results = this.Invoke("DeleteOrganization", new object[] {
                        orgId});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginDeleteOrganization(System.Guid orgId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("DeleteOrganization", new object[] {
                        orgId}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndDeleteOrganization(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void DeleteOrganizationAsync(System.Guid orgId) {
            this.DeleteOrganizationAsync(orgId, null);
        }
        
        /// <remarks/>
        public void DeleteOrganizationAsync(System.Guid orgId, object userState) {
            if ((this.DeleteOrganizationOperationCompleted == null)) {
                this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted);
            }
            this.InvokeAsync("DeleteOrganization", new object[] {
                        orgId}, this.DeleteOrganizationOperationCompleted, userState);
        }
        
        private void OnDeleteOrganizationOperationCompleted(object arg) {
            if ((this.DeleteOrganizationCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.DeleteOrganizationCompleted(this, new DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/CreateCRMUser", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public UserResult CreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType) {
            object[] results = this.Invoke("CreateCRMUser", new object[] {
                        user,
                        orgName,
                        organizationId,
                        baseUnitId,
                        CALType});
            return ((UserResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CreateCRMUser", new object[] {
                        user,
                        orgName,
                        organizationId,
                        baseUnitId,
                        CALType}, callback, asyncState);
        }
        
        /// <remarks/>
        public UserResult EndCreateCRMUser(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((UserResult)(results[0]));
        }
        
        /// <remarks/>
        public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType) {
            this.CreateCRMUserAsync(user, orgName, organizationId, baseUnitId, CALType, null);
        }
        
        /// <remarks/>
        public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType, object userState) {
            if ((this.CreateCRMUserOperationCompleted == null)) {
                this.CreateCRMUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCRMUserOperationCompleted);
            }
            this.InvokeAsync("CreateCRMUser", new object[] {
                        user,
                        orgName,
                        organizationId,
                        baseUnitId,
                        CALType}, this.CreateCRMUserOperationCompleted, userState);
        }
        
        private void OnCreateCRMUserOperationCompleted(object arg) {
            if ((this.CreateCRMUserCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.CreateCRMUserCompleted(this, new CreateCRMUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetOrganizationBusinessUnits", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CRMBusinessUnitsResult GetOrganizationBusinessUnits(System.Guid organizationId, string orgName) {
            object[] results = this.Invoke("GetOrganizationBusinessUnits", new object[] {
                        organizationId,
                        orgName});
            return ((CRMBusinessUnitsResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetOrganizationBusinessUnits(System.Guid organizationId, string orgName, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetOrganizationBusinessUnits", new object[] {
                        organizationId,
                        orgName}, callback, asyncState);
        }
        
        /// <remarks/>
        public CRMBusinessUnitsResult EndGetOrganizationBusinessUnits(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CRMBusinessUnitsResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetOrganizationBusinessUnitsAsync(System.Guid organizationId, string orgName) {
            this.GetOrganizationBusinessUnitsAsync(organizationId, orgName, null);
        }
        
        /// <remarks/>
        public void GetOrganizationBusinessUnitsAsync(System.Guid organizationId, string orgName, object userState) {
            if ((this.GetOrganizationBusinessUnitsOperationCompleted == null)) {
                this.GetOrganizationBusinessUnitsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationBusinessUnitsOperationCompleted);
            }
            this.InvokeAsync("GetOrganizationBusinessUnits", new object[] {
                        organizationId,
                        orgName}, this.GetOrganizationBusinessUnitsOperationCompleted, userState);
        }
        
        private void OnGetOrganizationBusinessUnitsOperationCompleted(object arg) {
            if ((this.GetOrganizationBusinessUnitsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetOrganizationBusinessUnitsCompleted(this, new GetOrganizationBusinessUnitsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetAllCrmRoles", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmRolesResult GetAllCrmRoles(string orgName, System.Guid businessUnitId) {
            object[] results = this.Invoke("GetAllCrmRoles", new object[] {
                        orgName,
                        businessUnitId});
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetAllCrmRoles(string orgName, System.Guid businessUnitId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetAllCrmRoles", new object[] {
                        orgName,
                        businessUnitId}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmRolesResult EndGetAllCrmRoles(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetAllCrmRolesAsync(string orgName, System.Guid businessUnitId) {
            this.GetAllCrmRolesAsync(orgName, businessUnitId, null);
        }
        
        /// <remarks/>
        public void GetAllCrmRolesAsync(string orgName, System.Guid businessUnitId, object userState) {
            if ((this.GetAllCrmRolesOperationCompleted == null)) {
                this.GetAllCrmRolesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAllCrmRolesOperationCompleted);
            }
            this.InvokeAsync("GetAllCrmRoles", new object[] {
                        orgName,
                        businessUnitId}, this.GetAllCrmRolesOperationCompleted, userState);
        }
        
        private void OnGetAllCrmRolesOperationCompleted(object arg) {
            if ((this.GetAllCrmRolesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetAllCrmRolesCompleted(this, new GetAllCrmRolesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetCrmUserRoles", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmRolesResult GetCrmUserRoles(string orgName, System.Guid userId) {
            object[] results = this.Invoke("GetCrmUserRoles", new object[] {
                        orgName,
                        userId});
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCrmUserRoles(string orgName, System.Guid userId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCrmUserRoles", new object[] {
                        orgName,
                        userId}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmRolesResult EndGetCrmUserRoles(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetCrmUserRolesAsync(string orgName, System.Guid userId) {
            this.GetCrmUserRolesAsync(orgName, userId, null);
        }
        
        /// <remarks/>
        public void GetCrmUserRolesAsync(string orgName, System.Guid userId, object userState) {
            if ((this.GetCrmUserRolesOperationCompleted == null)) {
                this.GetCrmUserRolesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCrmUserRolesOperationCompleted);
            }
            this.InvokeAsync("GetCrmUserRoles", new object[] {
                        orgName,
                        userId}, this.GetCrmUserRolesOperationCompleted, userState);
        }
        
        private void OnGetCrmUserRolesOperationCompleted(object arg) {
            if ((this.GetCrmUserRolesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCrmUserRolesCompleted(this, new GetCrmUserRolesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/SetUserRoles", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject SetUserRoles(string orgName, System.Guid userId, System.Guid[] roles) {
            object[] results = this.Invoke("SetUserRoles", new object[] {
                        orgName,
                        userId,
                        roles});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSetUserRoles(string orgName, System.Guid userId, System.Guid[] roles, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("SetUserRoles", new object[] {
                        orgName,
                        userId,
                        roles}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndSetUserRoles(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void SetUserRolesAsync(string orgName, System.Guid userId, System.Guid[] roles) {
            this.SetUserRolesAsync(orgName, userId, roles, null);
        }
        
        /// <remarks/>
        public void SetUserRolesAsync(string orgName, System.Guid userId, System.Guid[] roles, object userState) {
            if ((this.SetUserRolesOperationCompleted == null)) {
                this.SetUserRolesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserRolesOperationCompleted);
            }
            this.InvokeAsync("SetUserRoles", new object[] {
                        orgName,
                        userId,
                        roles}, this.SetUserRolesOperationCompleted, userState);
        }
        
        private void OnSetUserRolesOperationCompleted(object arg) {
            if ((this.SetUserRolesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SetUserRolesCompleted(this, new SetUserRolesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/SetUserCALType", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject SetUserCALType(string orgName, System.Guid userId, int CALType) {
            object[] results = this.Invoke("SetUserCALType", new object[] {
                        orgName,
                        userId,
                        CALType});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSetUserCALType(string orgName, System.Guid userId, int CALType, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("SetUserCALType", new object[] {
                        orgName,
                        userId,
                        CALType}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndSetUserCALType(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void SetUserCALTypeAsync(string orgName, System.Guid userId, int CALType) {
            this.SetUserCALTypeAsync(orgName, userId, CALType, null);
        }
        
        /// <remarks/>
        public void SetUserCALTypeAsync(string orgName, System.Guid userId, int CALType, object userState) {
            if ((this.SetUserCALTypeOperationCompleted == null)) {
                this.SetUserCALTypeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserCALTypeOperationCompleted);
            }
            this.InvokeAsync("SetUserCALType", new object[] {
                        orgName,
                        userId,
                        CALType}, this.SetUserCALTypeOperationCompleted, userState);
        }
        
        private void OnSetUserCALTypeOperationCompleted(object arg) {
            if ((this.SetUserCALTypeCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SetUserCALTypeCompleted(this, new SetUserCALTypeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetCrmUserByDomainName", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmUserResult GetCrmUserByDomainName(string domainName, string orgName) {
            object[] results = this.Invoke("GetCrmUserByDomainName", new object[] {
                        domainName,
                        orgName});
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCrmUserByDomainName(string domainName, string orgName, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCrmUserByDomainName", new object[] {
                        domainName,
                        orgName}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmUserResult EndGetCrmUserByDomainName(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetCrmUserByDomainNameAsync(string domainName, string orgName) {
            this.GetCrmUserByDomainNameAsync(domainName, orgName, null);
        }
        
        /// <remarks/>
        public void GetCrmUserByDomainNameAsync(string domainName, string orgName, object userState) {
            if ((this.GetCrmUserByDomainNameOperationCompleted == null)) {
                this.GetCrmUserByDomainNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCrmUserByDomainNameOperationCompleted);
            }
            this.InvokeAsync("GetCrmUserByDomainName", new object[] {
                        domainName,
                        orgName}, this.GetCrmUserByDomainNameOperationCompleted, userState);
        }
        
        private void OnGetCrmUserByDomainNameOperationCompleted(object arg) {
            if ((this.GetCrmUserByDomainNameCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCrmUserByDomainNameCompleted(this, new GetCrmUserByDomainNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetCrmUserById", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmUserResult GetCrmUserById(System.Guid crmUserId, string orgName) {
            object[] results = this.Invoke("GetCrmUserById", new object[] {
                        crmUserId,
                        orgName});
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCrmUserById(System.Guid crmUserId, string orgName, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCrmUserById", new object[] {
                        crmUserId,
                        orgName}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmUserResult EndGetCrmUserById(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetCrmUserByIdAsync(System.Guid crmUserId, string orgName) {
            this.GetCrmUserByIdAsync(crmUserId, orgName, null);
        }
        
        /// <remarks/>
        public void GetCrmUserByIdAsync(System.Guid crmUserId, string orgName, object userState) {
            if ((this.GetCrmUserByIdOperationCompleted == null)) {
                this.GetCrmUserByIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCrmUserByIdOperationCompleted);
            }
            this.InvokeAsync("GetCrmUserById", new object[] {
                        crmUserId,
                        orgName}, this.GetCrmUserByIdOperationCompleted, userState);
        }
        
        private void OnGetCrmUserByIdOperationCompleted(object arg) {
            if ((this.GetCrmUserByIdCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCrmUserByIdCompleted(this, new GetCrmUserByIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/ChangeUserState", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject ChangeUserState(bool disable, string orgName, System.Guid crmUserId) {
            object[] results = this.Invoke("ChangeUserState", new object[] {
                        disable,
                        orgName,
                        crmUserId});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginChangeUserState(bool disable, string orgName, System.Guid crmUserId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("ChangeUserState", new object[] {
                        disable,
                        orgName,
                        crmUserId}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndChangeUserState(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void ChangeUserStateAsync(bool disable, string orgName, System.Guid crmUserId) {
            this.ChangeUserStateAsync(disable, orgName, crmUserId, null);
        }
        
        /// <remarks/>
        public void ChangeUserStateAsync(bool disable, string orgName, System.Guid crmUserId, object userState) {
            if ((this.ChangeUserStateOperationCompleted == null)) {
                this.ChangeUserStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeUserStateOperationCompleted);
            }
            this.InvokeAsync("ChangeUserState", new object[] {
                        disable,
                        orgName,
                        crmUserId}, this.ChangeUserStateOperationCompleted, userState);
        }
        
        private void OnChangeUserStateOperationCompleted(object arg) {
            if ((this.ChangeUserStateCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.ChangeUserStateCompleted(this, new ChangeUserStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetDBSize", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public long GetDBSize(System.Guid organizationId) {
            object[] results = this.Invoke("GetDBSize", new object[] {
                        organizationId});
            return ((long)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetDBSize(System.Guid organizationId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetDBSize", new object[] {
                        organizationId}, callback, asyncState);
        }
        
        /// <remarks/>
        public long EndGetDBSize(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((long)(results[0]));
        }
        
        /// <remarks/>
        public void GetDBSizeAsync(System.Guid organizationId) {
            this.GetDBSizeAsync(organizationId, null);
        }
        
        /// <remarks/>
        public void GetDBSizeAsync(System.Guid organizationId, object userState) {
            if ((this.GetDBSizeOperationCompleted == null)) {
                this.GetDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDBSizeOperationCompleted);
            }
            this.InvokeAsync("GetDBSize", new object[] {
                        organizationId}, this.GetDBSizeOperationCompleted, userState);
        }
        
        private void OnGetDBSizeOperationCompleted(object arg) {
            if ((this.GetDBSizeCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetDBSizeCompleted(this, new GetDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/GetMaxDBSize", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public long GetMaxDBSize(System.Guid organizationId) {
            object[] results = this.Invoke("GetMaxDBSize", new object[] {
                        organizationId});
            return ((long)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetMaxDBSize(System.Guid organizationId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetMaxDBSize", new object[] {
                        organizationId}, callback, asyncState);
        }
        
        /// <remarks/>
        public long EndGetMaxDBSize(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((long)(results[0]));
        }
        
        /// <remarks/>
        public void GetMaxDBSizeAsync(System.Guid organizationId) {
            this.GetMaxDBSizeAsync(organizationId, null);
        }
        
        /// <remarks/>
        public void GetMaxDBSizeAsync(System.Guid organizationId, object userState) {
            if ((this.GetMaxDBSizeOperationCompleted == null)) {
                this.GetMaxDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMaxDBSizeOperationCompleted);
            }
            this.InvokeAsync("GetMaxDBSize", new object[] {
                        organizationId}, this.GetMaxDBSizeOperationCompleted, userState);
        }
        
        private void OnGetMaxDBSizeOperationCompleted(object arg) {
            if ((this.GetMaxDBSizeCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetMaxDBSizeCompleted(this, new GetMaxDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/solidcp/server/SetMaxDBSize", RequestNamespace="http://smbsaas/solidcp/server/", ResponseNamespace="http://smbsaas/solidcp/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject SetMaxDBSize(System.Guid organizationId, long maxSize) {
            object[] results = this.Invoke("SetMaxDBSize", new object[] {
                        organizationId,
                        maxSize});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSetMaxDBSize(System.Guid organizationId, long maxSize, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("SetMaxDBSize", new object[] {
                        organizationId,
                        maxSize}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndSetMaxDBSize(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void SetMaxDBSizeAsync(System.Guid organizationId, long maxSize) {
            this.SetMaxDBSizeAsync(organizationId, maxSize, null);
        }
        
        /// <remarks/>
        public void SetMaxDBSizeAsync(System.Guid organizationId, long maxSize, object userState) {
            if ((this.SetMaxDBSizeOperationCompleted == null)) {
                this.SetMaxDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMaxDBSizeOperationCompleted);
            }
            this.InvokeAsync("SetMaxDBSize", new object[] {
                        organizationId,
                        maxSize}, this.SetMaxDBSizeOperationCompleted, userState);
        }
        
        private void OnSetMaxDBSizeOperationCompleted(object arg) {
            if ((this.SetMaxDBSizeCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SetMaxDBSizeCompleted(this, new SetMaxDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public OrganizationResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((OrganizationResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetSupportedCollationNamesCompletedEventHandler(object sender, GetSupportedCollationNamesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetSupportedCollationNamesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetSupportedCollationNamesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string[])(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCurrencyListCompletedEventHandler(object sender, GetCurrencyListCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCurrencyListCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCurrencyListCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public Currency[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((Currency[])(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetInstalledLanguagePacksCompletedEventHandler(object sender, GetInstalledLanguagePacksCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetInstalledLanguagePacksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetInstalledLanguagePacksCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public int[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((int[])(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void CreateCRMUserCompletedEventHandler(object sender, CreateCRMUserCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class CreateCRMUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal CreateCRMUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public UserResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((UserResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetOrganizationBusinessUnitsCompletedEventHandler(object sender, GetOrganizationBusinessUnitsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetOrganizationBusinessUnitsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetOrganizationBusinessUnitsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CRMBusinessUnitsResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CRMBusinessUnitsResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetAllCrmRolesCompletedEventHandler(object sender, GetAllCrmRolesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetAllCrmRolesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetAllCrmRolesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmRolesResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmRolesResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCrmUserRolesCompletedEventHandler(object sender, GetCrmUserRolesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCrmUserRolesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCrmUserRolesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmRolesResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmRolesResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void SetUserRolesCompletedEventHandler(object sender, SetUserRolesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class SetUserRolesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SetUserRolesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void SetUserCALTypeCompletedEventHandler(object sender, SetUserCALTypeCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class SetUserCALTypeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SetUserCALTypeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCrmUserByDomainNameCompletedEventHandler(object sender, GetCrmUserByDomainNameCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCrmUserByDomainNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCrmUserByDomainNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmUserResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmUserResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCrmUserByIdCompletedEventHandler(object sender, GetCrmUserByIdCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCrmUserByIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCrmUserByIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmUserResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmUserResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void ChangeUserStateCompletedEventHandler(object sender, ChangeUserStateCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class ChangeUserStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal ChangeUserStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetDBSizeCompletedEventHandler(object sender, GetDBSizeCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public long Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((long)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetMaxDBSizeCompletedEventHandler(object sender, GetMaxDBSizeCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetMaxDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetMaxDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public long Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((long)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void SetMaxDBSizeCompletedEventHandler(object sender, SetMaxDBSizeCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class SetMaxDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SetMaxDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
}
